package edu.nf.ch02.service;

import edu.nf.ch02.entity.User;
import edu.nf.ch02.mapper.UserMapper;
import edu.nf.ch02.util.MybatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

/**
 * @author CSY
 * @date 2025 - 04 - 23
 */
public class UserService {
    public void save(User user){
        try(SqlSession session = MybatisUtils.getSqlSession()){

            UserMapper proxy = session.getMapper(UserMapper.class);

            proxy.save(user);
        }
    }
}
